Large scale computer programs comprise many functional components that generate information that is presented to a user. An example of such a component is a component that implements a command in a command line interface. When a user enters a command into a command line client to invoke the component, the component executes and produces a set of generated output. That generated output is then sent back to the command line client to be presented to the user.
Traditionally, the output that is generated by the component is in a form that is ready for consumption and presentation by the command line client. For example, if the generated information is to be presented to a user in a table format, then the output will already be arranged in table format. If the generated information is to be presented in a list format, then it will already be in a list format. In addition to setting forth the format, the output will also be of a type that is expected by the command line client. Typically, command line clients are text based; thus, the output of the component is usually in the form of text.
Having the component generate output that is ready for consumption and presentation by the client is fine when the output is consumed by only one type of client. However, in current large scale programs, the output from a functional component may be consumed by many different types of clients, which may include text-based clients, web-based clients, graphical user interface (GUI) clients, etc. To accommodate all of these different types of clients, significant code would have to be added to the functional component to enable it to generate all of these different types of outputs. This code would have to be added to every functional component (which could be very many in a large scale program) that produces output that is presented to a user. Furthermore, if another type of client is later added to a system, all of the functional components would have to be augmented to produce output that can be consumed by that type of client. Thus, as this discussion shows, the amount of development and maintenance effort could be immense. For at least these reasons, the approach of having the component generate output that is in a form that can be consumed and presented by a client is not practicable in many large scale programs.